/**
 * 
 */
package com.vmware.array2d.util;

import java.util.Iterator;

/**
 * Implementation for 2DArray class which can be iterated spirally.
 * @author anshuman
 *
 */
public class Array2DSpiralIterable<T> implements Iterable<T> {
    private T[][] array2d;
    
    /**
     * @param array2d
     * @param rows
     * @param cols
     */
    public Array2DSpiralIterable(T [][] array2d) {
       this.array2d = array2d;
    }

    @Override
    public Iterator<T> iterator() {
        return new SpriralIterator<T>(array2d);
    }

}
